/*                                  ATELIER                                   */

/* %%LICENSE_TAG%%                                                            */
package edu.gmu.view.canvas;

/**
 * The MouseModeEvent object represents change to an object with a MouseMode.
 */
@SuppressWarnings("serial")
public class MouseModeEvent extends java.util.EventObject
{   
    /**
     * The Data events Time stamp.  The time stamp is in
     * UTC format that indicates when the input event was
     * created.
     *
     * @see #getWhen()
     */
    protected long when;
    
    
    /**
     * Old MouseMode.
     */
    protected MouseMode oldMouseMode = null;
    
    /**
     * New MouseMode.
     */
    protected MouseMode newMouseMode = null;

    /**
     * Constructs a MouseModeEvent object with the specified parameters.
     *
     * @param source
     * @param when
     * @param newMouseMode 
     * @param oldMouseMode
     */
    public MouseModeEvent(  Object source, long when,
                            MouseMode oldMouseMode,
                            MouseMode newMouseMode)
    {
        super(source);
        this.when = when;
        this.oldMouseMode = oldMouseMode;
        this.newMouseMode = newMouseMode;
    }


    /**
     * Returns the timestamp of when this event occurred.
     *
     * @return long
     */
    public long getWhen()
    {
        return this.when;
    }
    
    /**
     * Gets old MouseMode.
     *
     * @return MouseMode oldMouseMode
     */
    public MouseMode getOldValue( )
    {
        return this.oldMouseMode;
    }
    
    /**
     * Gets new MouseMode.
     *
     * @return MouseMode newMouseMode
     */
    public MouseMode getNewValue( )
    {
        return this.newMouseMode;
    }

    /**
     * Returns a String object representing this Event's values.
     *
     * @return  String object representing this object.
     */
    public String toString()
    {
        return new String(super.toString() +
                          "\n     when: " + this.getWhen()
                          );
    }

}

/*                                  ATELIER                                   */